<template>
  <view>
    <text style="font-size: 100rpx">{{ settingStore.flag }}</text>
    <button type="default" @click="handleClick">改变</button>
    <button v-for="item in pages" :key="item.url" @click="to(item)">用户页面</button>
  </view>
</template>

<script setup>
import { ref } from 'vue'
import { useSettingStore } from '@/store/modules/setting'

const settingStore = useSettingStore()
const handleClick = () => {
  settingStore.setFlag(!settingStore.flag)
}
const pages = ref([
  {
    url: '/pages/user/user',
    label: '用户页面'
  }
])
const to = (item) => {
  uni.navigateTo({
    url: item.url
  })
}
</script>

<style lang="scss" scoped></style>
